home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / DESK / CORE / Desk / h / Error2 < prev    next >
Text File  |  1996-08-16  |  4KB  |  91 lines

  1.  
  2. #ifndef __Desk_Error2_h
  3. #define __Desk_Error2_h
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #include <stdio.h>
  8. #include <stdarg.h>
  9. #ifndef __Desk_Error_h
  10. #include "Error.h"
  11. #endif
  12. #ifndef __Desk_Jump_h
  13. #include "JumpRaw.h"
  14. #endif
  15. typedef enum {
  16. Desk_error2_type_NONE = 0,
  17. Desk_error2_type_MISC = 1, 
  18. Desk_error2_type_OSERROR = 2, 
  19. Desk_error2_type_DESKMEM = 3, 
  20. Desk_error2_type_SIGNAL = 4, 
  21. Desk_error2_type_MEM = 5, 
  22. Desk_error2_type_TEXT = 6 
  23. }
  24. Desk_error2_type;
  25. typedef struct Desk_error2_block {
  26. Desk_error2_type type;
  27. union {
  28. void* misc;
  29. const Desk_os_error* oserror;
  30. struct Desk_deskmem_errorblock* deskmem;
  31. int signal;
  32. const char* text;
  33. }
  34. data;
  35. }
  36. Desk_error2_block;
  37. void Desk_Error2_Init_JumpSig(void);
  38. void Desk_Error2_Handle(Desk_error2_block* error);
  39. #define Desk_Error2_Try Desk_JumpAuto_Try
  40. #define Desk_Error2_Catch Desk_JumpAuto_Catch
  41. #define Desk_Error2_EndCatch Desk_JumpAuto_EndCatch
  42. #define Desk_Error2_TryCatch Desk_JumpAuto_TryCatch
  43. Desk_error2_block *Desk_Error2_Exit(Desk_error2_block *error);
  44. Desk_error2_block *Desk_Error2_VerboseExit(Desk_error2_block *error);
  45. typedef int (*Desk_Error2_vprintf_fn)(void* reference, const char* format, va_list va);
  46. typedef int (*Desk_Error2_printf_fn)(void* reference, const char* format, ...);
  47. void Desk_Error2_VDescribe(Desk_Error2_vprintf_fn fn, void* reference, const Desk_error2_block* error);
  48. void Desk_Error2_FDescribe(Desk_Error2_printf_fn fn, void* reference, const Desk_error2_block* error);
  49. void Desk_Error2_Describe(FILE* stream, const Desk_error2_block* error);
  50. typedef Desk_error2_block* (*Desk_error2_handler)(Desk_error2_block *error);
  51. #define Desk_error2_HANDLED (NULL)
  52. #define Desk_Error2_SetHandler(handlerfn) Desk_error2__handlerfn = (handlerfn)
  53. #define Desk_Error2_GetHandler() Desk_error2__handlerfn
  54. int Desk_Error2_GetNewErrorType(void);
  55. void Desk_Error2_CheckOS(const Desk_os_error *error);
  56. void Desk_Error2_CheckOS_Debug(const Desk_os_error *error, const char *place);
  57. #if defined(Desk_DeskLib_DEBUG) && !defined(Desk__making_Error2)
  58. #define Desk_Error2_CheckOS(oserror) Desk_Error2_CheckOS_Debug(oserror, Desk_error_PLACE)
  59. #endif
  60. void Desk_Error2_CheckBOOL(Desk_bool error);
  61. void Desk_Error2_HandleText(const char* text);
  62. void Desk_Error2_HandleTextf(const char* text, ...);
  63. void Desk_Error2_SignalHandler(int signalnumber);
  64. void Desk_Error2_HandleAllSignals(void);
  65. void Desk_Error2_ClearErrorBlock(Desk_error2_block *error);
  66. #ifdef Desk__using_SDLS
  67. extern Desk_error2_block* Desk_Error2__Ref_globalblock(void);
  68. extern Desk_error2_handler* Desk_Error2__Ref__handlerfn(void);
  69. #endif
  70. #if defined(Desk__using_SDLS) && !defined(Desk__making_Error2)
  71. #define Desk_error2_globalblock (*Desk_Error2__Ref_globalblock())
  72. #define Desk_error2__handlerfn (*Desk_Error2__Ref__handlerfn())
  73. #else
  74. extern Desk_error2_block Desk_Error2_globalblock;
  75. extern Desk_error2_handler Desk_error2__handlerfn;
  76. #endif
  77. #define Desk_Error2_ReThrow() Desk_Error2_Handle(&Desk_Error2_globalblock)
  78. extern const char *Desk_Error2_signalnames[];
  79. void Desk_Error2_ConvertToOS(Desk_os_error* oserror, Desk_error2_block* error2);
  80. #define Desk_Error3_UseError3() Desk_Error2_SetHandler(Desk_Error3__Dispatch);
  81. typedef Desk_error2_block* (*Desk_error3_handler)(Desk_error2_block *error, void *reference);
  82. void Desk_Error3_ClaimType(Desk_error2_type type, Desk_error3_handler handler, void *reference);
  83. void Desk_Error3_ClaimMisc(Desk_error3_handler handler, void *reference);
  84. void Desk_Error3_ReleaseType(Desk_error2_type type, Desk_error3_handler handler, void *reference);
  85. void Desk_Error3_ReleaseMisc(Desk_error3_handler handler, void *reference);
  86. Desk_error2_block* Desk_Error3__Dispatch(Desk_error2_block* error, void* reference);
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif
  91.